package com.aaa.phone.controller.personalcontroller;

import com.aaa.phone.service.ipersonalservice.IUpdateUsernameAndImage;
import com.aaa.util.PictureUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.util.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;

/**
 * @program: battery
 * @description: 更换用户头像和昵称
 * @author: 王璐
 * @create: 2018-12-19 12:21
 **/
@CrossOrigin
@RestController
@RequestMapping("/UploadHeadImgAndUserName")
public class UpdateHeadImgAndUserName {
    /**
     * 自动注入
     */
    @Autowired
    private IUpdateUsernameAndImage service;

    /**
     * 更改用户头像和昵称
     * @param img
     * @param nickname
     * @param phone
     * @return
     */
    @RequestMapping("/update")
    public int updateUser(String img, String nickname, String phone) {
        return service.update(img,nickname,phone);
    }
}